//
//  Generics.swift
//  BJ12366Swift
//
//  Created by ZRAR on 16/3/1.
//  Copyright © 2016年 ZRAR. All rights reserved.
//

import UIKit

class Generics: NSObject {
    
    //泛型函数
    func swapTwoValues<T>(inout a:T,inout b:T){
        
        let tempararyA = a
        a = b
        b = tempararyA
        
    }
    override init(){
        super.init()
        var a = 10
        var b = 20
        swapTwoValues(&a, b: &b)
        var strA = "111"
        var strB = "222"
        swapTwoValues(&strA, b: &strB)
        
    }
}
